package edu.hawaii.ics466.tasks;

import java.util.HashMap;
import java.util.Map;

import android.os.AsyncTask;
import android.util.Log;

public class GetGameList extends AsyncTask<String, Void, String[]> {

	@Override
	protected String[] doInBackground(String... params) {
		String searchTerm = (params.length > 0) ? params[0] : "";

		Map<String, String> requestParams = new HashMap<String, String>();
		requestParams.put("searchTerm", searchTerm);
		String response = Ajax.send("http://the-game-rater.comuf.com/app/get_game_list.php", requestParams);
		if (response != null) {
			String[] gameList = response.split(";");
			return gameList;
		}
		return null;
	}

}
